import { service } from '../index'
import { IhomeData, IlistData, IClassify, ICity } from '../typing'

type Res<T> = Promise<ItypeAPI<T>>;
// 一般情况下响应数据返回的这三个参数，
// 但不排除后端返回其它的可能性，
interface ItypeAPI<T> {
  msg: T; // 返回状态码的信息，如请求成功等
  code: number; //返回后端自定义的200，404，500这种状态码
}

// 七天速成
export function speed(data): Res<any> {
  return service.post<object>('/speed/index',data)
}
//报名表单页面数据
export function enrollForm(data): Res<any> {
  return service.post<object>('/speed/enrollForm',data)
}
//七天速成添加订单
export function addOrder(data): Res<any> {
  return service.post<object>('/speed/addOrder',data)
}
//收银台
export function speedCashier(data): Res<any> {
  return service.post<object>('/speed/cashier',data)
}
//支付
export function speedOrderPay(data): Res<any> {
  return service.post<object>('/speed/orderPay',data)
}
//七天速成排期报名列表
export function speedOrderList(data): Res<any> {
  return service.post<object>('/speed/orderList',data)
}
//七天速成报名订单详情
export function speedOrderDetail(data): Res<any> {
  return service.post<object>('/speed/orderDetail',data)
}
//七天速成订单报名信息
export function speedFormInfo(data): Res<any> {
  return service.post<object>('/speed/formInfo',data)
}
//报名记录
export function speedEnrollRecord(data): Res<any> {
  return service.post<object>('/speed/enrollRecord',data)
}
//取消报名
export function speedOrderCancel(data): Res<any> {
  return service.post<object>('/speed/orderCancel',data)
}